package com.kongjs.application.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kongjs.application.enums.OperationName;
import com.kongjs.application.enums.OperationType;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@ToString
@TableName("operation_log")
@Entity
public class OperationLog implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Id
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    @TableField("operation_name")
    private OperationName operationName;
    @TableField("operation_type")
    private OperationType operationType;
    @TableField("operation_time")
    private LocalDateTime operationTime;
    @TableField("operation_ipaddr")
    private String operationIpaddr;
    @TableField("operation_ipinfo")
    private String operationIpinfo;
    @TableField("operation_path")
    private String operationPath;
    @TableField("operation_method")
    private String operationMethod;
    @TableField("operation_param")
    private String operationParam;
    @TableField("operation_message")
    private String operationMessage;
    @TableField("operation_exception")
    private String operationException;
    @TableField("operation_result")
    private String operationResult;
    @TableField("execution_time")
    private Long executionTime;
    @TableField("resource_id")
    private Long resourceId;
    @TableField("resource_type")
    private String resourceType;
    @TableField("tenant_id")
    private Long tenantId;
    @TableField("user_id")
    private Long userId;
    @TableField("user_name")
    private String userName;
}
